package com.springboot.oss.controller;

import com.springboot.commonutils.R;
import com.springboot.oss.service.Impl.OssServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/eduoss/file")
@CrossOrigin
public class OssController {

    @Autowired
    private OssServiceImpl ossService;

    @ApiOperation(value = "头像上传")
    @PostMapping()
    public R uploadossfile(MultipartFile file){
        String uplotdfile = ossService.uplotdfile(file);
        return R.ok().data("uplotdfile",uplotdfile);
    }
}
